const { Configuration, OpenAIApi } = require("openai");
const dotnev = require('dotenv')
dotnev.config()

async function main(){
    const configuration = new Configuration({
        apiKey: process.env.OPENAI_API_KEY,
    });
    const openai = new OpenAIApi(configuration);
    
    const response = await openai.createCompletion({
        model: "text-davinci-003",
        prompt: 'axios是什么',
        temperature: 0.9,
        max_tokens: 400,
        top_p: 1,
        frequency_penalty: 0,
        presence_penalty: 0.6
    });

    console.log(response.data.choices[0].text.trim())
    
}

main()